<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引包 -->
    <script src="../js/vue.js"></script>
</head>
<body>
    <!-- 容器|模板 -->
    <div id="app">
        <h1 ref="tab">ghhhh</h1>
        <button @click="handle">点击按钮弹出文本内容</button>
    </div>
</body>
</html>
<script>
     //关联VM
     const VM = new Vue({
         el:'#app',
         methods:{
             handle(){

                console.log(this)
                 alert(this.$refs.tab.innerHTML)
             }
         }
     })
</script>